package monopoly;

import java.util.Random;

/** 
 * Class Die
 * @author manijshrestha
 *
 */

public class Die {

	private Random rand; // to generate Random number
	private int faceValue;
	
	// Default Constructor
	public Die(){
	 rand = new Random();	
	 faceValue = 6;
	}
	
	// method to give a value
	public void roll() {
		int number = 0;
		 number = rand.nextInt(6); // Gives number between 0-5
		faceValue = number + 1; // adding 1 to make it 1-6
	}

	public int getFaceValue()
	{
		return faceValue;
	}
	
	public void setFaceValue(int n)
	{
		this.faceValue = n;
	}
	
	public String getFN()
	{
		String fn = "";
		switch (faceValue)
		{
		case 0 : fn = "images/Die/die0.gif"; break;
		case 1 : fn = "images/Die/die1.gif"; break;
		case 2 : fn = "images/Die/die2.gif"; break;
		case 3 : fn = "images/Die/die3.gif"; break;
		case 4 : fn = "images/Die/die4.gif"; break;
		case 5 : fn = "images/Die/die5.gif"; break;
		case 6 : fn = "images/Die/die6.gif"; break;
		}
		return fn;
		
	}
}
